<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    {% block title %}
        <title>version_control</title>
    {% endblock %}
    <link href="/static/plugin/bootstratp/css/bootstrap.min.css" rel="stylesheet">
    <link href="/static/plugin/bootstratp/css/bootstrap-theme.min.css" rel="stylesheet">
    <link href="/static/plugin/bootstratp/css/dashboard.css" rel="stylesheet">
    <link href="/static/plugin/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet">
    <link href="/static/plugin/bootstrap-switch/css/bootstrap-switch.min.css" rel="stylesheet">
    {% block custome_css %}{% endblock %}
</head>
<body>
    {% block body %}{% endblock %}
    <script src="/static/plugin/jquery/jquery.min.js"></script>
    <script src="/static/plugin/bootstratp/js/bootstrap.min.js"></script>
    <script src="/static/plugin/jquery/jquery.cookie.js"></script>
    <script src="/static/plugin/bootstrap-select/js/bootstrap-select.min.js"></script>
    <script src="/static/plugin/bootstrap-switch/js/bootstrap-switch.min.js"></script>
    <script>
        function csrfSafeMethod(method) {
            return (/^(GET|HEAD|OPTIONS|TRACE)$/.test(method));    // 这些请求不需要带上CSRF
        }
        $.ajaxSetup({
           beforeSend: function (xhr, settings) {
               if (!csrfSafeMethod(settings.type) && !this.crossDomain) {
                    xhr.setRequestHeader("X-CSRFToken",  $.cookie('csrftoken'));  // 给下面所有的ajax添加csrf
                }
           }
        });
    </script>
    {% block custome_js %}{% endblock %}
</body>
</html>